<?php
$host = "0.0.0.0";
$port = 9502;
$mode = SWOOLE_PROCESS;
$sock_type = SWOOLE_SOCK_UDP;
$server = new swoole_server($host,$port,$mode,$sock_type);
$server->on("packet",function($server,$data,$fd){
    $server->sendto($fd['address'],$fd['port'],"你的IP是: ".$fd['address']."；你发的内容是 $data");
    var_dump($fd);
});
$server->start();